/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

/**
 *
 * @author 10520_000
 */
public class ViTri implements Idata
{
    private String MaViTri;
    public String TenViTri;
    public boolean NhapSach;
    public boolean LapHoaDon;
    public boolean TraCuuSach;
    public boolean LapPhieuThuTien;
    public boolean LapBaoCao;
    public boolean ThayDoiQuyDinh;
    public boolean PhanQuyen;
    public ViTri(String ...param)
    {
        MaViTri = param[0];
        TenViTri = param[1];
        NhapSach = param[2].contains("true");
        LapHoaDon = param[3].contains("true");
        TraCuuSach = param[4].contains("true");
        LapPhieuThuTien = param[5].contains("true");
        LapBaoCao = param[6].contains("true");
        ThayDoiQuyDinh = param[7].contains("true");
        PhanQuyen = param[8].contains("true");
    }

    @Override
    public boolean Delete() 
    {
        return new BUS.Sach().Delete(this);
    }

    @Override
    public boolean Insert() 
    {
//        MaViTri, TenViTri,NhapSach? "true":"false", 
//                LapHoaDon ? "true":"false", TraCuuSach ? "true":"false", LapPhieuThuTien ? "true":"false",
//                LapBaoCao ? "true":"false", ThayDoiQuyDinh ? "true":"false", PhanQuyen ? "true":"false"
        return new BUS.Sach().Insert(this);
    }

    @Override
    public boolean Update() 
    {
//        MaViTri, TenViTri,NhapSach? "true":"false", 
//                LapHoaDon ? "true":"false", TraCuuSach ? "true":"false", LapPhieuThuTien ? "true":"false",
//                LapBaoCao ? "true":"false", ThayDoiQuyDinh ? "true":"false", PhanQuyen ? "true":"false"
        return new  BUS.Sach().Update(this);
    }

    @Override
    public Object[] getObjects() 
    {
        return new Object[] 
        {
            MaViTri, TenViTri, NhapSach, LapHoaDon, TraCuuSach, LapPhieuThuTien, LapBaoCao, ThayDoiQuyDinh, PhanQuyen
        };
    }
    @Override
    public String getID() 
    {
        return MaViTri;
    }
    
    
    
}
